import { Dispatch, memo } from "react";
import styles from "./audio.module.scss";
let Audio: React.FC<{ src: string; display?: boolean; setDis?: Dispatch<boolean> }> = ({
  src,
  display,
  setDis,
}) => {
  return (
    <>
      {display && (
        <div className={styles.audio}>
          <i onClick={() => setDis!(false)}>×</i>
          <audio src={src} controls></audio>
        </div>
      )}
    </>
  );
};
export default memo(Audio);
